'use strict';
var Schema = require('mongoose').Schema,
    Model = require('../../../Base/server/controllers/Model');

var modelField = {};
modelField.Code = {
    type: String,
    trim: true,
    Name: '编码',
    IsUnique: true,
    IsEmpty: false,
    Name: '编码'
};

modelField.Name = {
    type: String,
    trim: true,
    Name: '名称',
    IsEmpty: false
};

modelField.URL = {
    type: String,
    Name: '地址'
};

modelField.Parent = {
    type: Schema.ObjectId,
    ref: 'Menu',
    Name: '上级菜单'
};

var newModel = new Model(modelField);
newModel.addIndex({Name: 1});
newModel.addIndex({Code: 1});
newModel.create('Menu', '菜单');
